/*
 * SalaryEmployee.java
 *
 * This class is a derived class inherited from Employee class, used to store
 * the salary details and display the same.
 *
 * 
 */

package com.javacore.day6.maxsoft1;

/**
 * SalaryEmployee class contains all the details of salaried employees.
 * @author 
 */
public class SalaryEmployee extends Employee {
    
    /** Creates a new instance of SalaryEmployee */
    public SalaryEmployee() {
    }
    
    /**
     * Creates a new instance of SalaryEmployee and stores salary
     * in the instance variable ans calls the base constructor.
     * @param newSalary Parameter containing the salary of the employee
     * @param name Parameter containing the name of the employee
     */
    public SalaryEmployee(String name, double currentSalary) {
        super(name);
        salary = currentSalary;
    }
    
    /**
     * Method to display the details of salaried employees.
     */
    void displayDetails() {
        super.displayDetails();
        System.out.printf("\n" + empName + "'s Salary: %.2f\n", salary);
    }
    
    /**
     * Instance variable salary to store salary for salaried employees.
     */
    double salary;
    
}
